/*
 * Listener.h
 *
 *  Created on: 2009-3-26
 *      Author: W. Wen Peng
 */

#ifndef LISTENER_H_
#define LISTENER_H_
#include "Socket.h"

class Listener:public Socket {
public:
	Listener():Socket(){
		m_event = ACCEPT_EVENT;
		m_passive = true;
	}

	//listener响应Accept
	int OnRead(Epoller &sender, EpollEventArg &e){
		return OnAccept(sender,e);
	}
	int OnWrite(Epoller &sender, EpollEventArg &e){
		return 0;
	}
	virtual int OnAccept(Epoller &sender,EpollEventArg &e);
//	int OnError(Epoller &sender, EpollEventArg &e);
	virtual ~Listener();
};

#endif /* LISTENER_H_ */
